package com.huluobo.a2303mdmdemo.demo

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.huluobo.lib_base.RoutePath

/**
 *  Created by LC on 2025/8/16.
 */

@Composable
fun MyNavigation() {
    //导航控制器
    val navHostController = rememberNavController()

    NavHost(navController = navHostController, startDestination = RoutePath.FIRST, builder = {
        //声明所有能出现在该NavHost的页面,声明的地址就是对应的路由
        composable(RoutePath.FIRST) { FirstPage(navHostController = navHostController) }
        composable(RoutePath.SEC) {
            //通过声明的/ 中的大括号来获取传递值的key
//            val json = it.arguments?.getString("json").toString()
            //如果传值需要在声明的时候来进行解析
            SecPage(navHostController = navHostController)
        }
    })

}